<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        ul,li{
            margin:0;
            padding:0;
            list-style: none;
        }

        ul{
            overflow: hidden;
        }
        li{
            width: 100px;
            height: 40px;
            background-color: #eee;
            border: 1px solid #ccc;
            float: left;
            line-height: 40px;
            text-align: center;
        }

        div{
            width: 406px;
            height: 406px;
            border: 1px solid #ccc;
        }
        img{
            width: 406px;
            height: 406px;
            display: none;
        }
    </style>
		<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.js"></script>
</head>
<body>
    <ul>
        <li>大橘</li>
        <li>英短</li>
        <li>美短</li>
        <li>布偶</li>
    </ul>
    <div>
        <img src="./ju.jpg" alt="" style="display: block;">
        <img src="./ying.jpg" alt="">
        <img src="./hu.jpg" alt="">
        <img src="./bu.jpg" alt="">
    </div>
    <script>
        // 逻辑：1.移动到哪个选项卡上，自己的背景颜色要改变  2.对应的内容区域要显示
        // 同理，移出时，背景颜色恢复，对应内容区域隐藏
		let last = 0;
		for(let i = 0; i < $('li').length; ++i){
			$("li").eq(i).mouseenter(function(){
			  $("li").eq(i).css("background-color","yellow");
			  $("img").eq(last).css('display', 'none');
			  $("img").eq(i).css('display', 'block');
			  last = i;
			});
			$("li").eq(i).mouseout(function(){
			  $("li").eq(i).css("background-color","#eee");
			}); 				
		}

    </script>
</body>
</html>